//
//  BottomBtn.m
//  EducationAdminClient
//
//  Created by 孙添凤 on 17/1/18.
//  Copyright © 2017年 周佳兴. All rights reserved.
//

#import "BottomBtn.h"
#import "Masonry.h"
@implementation BottomBtn

-(instancetype)init{
    if(self==[super init]){
        
        float width = self.frame.size.width;
        _btnImg =[[UIImageView alloc]init];
        [_btnImg sizeToFit];
        [self addSubview:_btnImg];
        [_btnImg mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.mas_left).offset(-width/3);
            make.centerY.equalTo(self.mas_centerY);
        }];
        _btnImg.image =[UIImage imageNamed:@"edit"];
        
        _btnTitle =[[UILabel alloc]init];
        [self addSubview:_btnTitle];
        [_btnTitle mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(_btnImg.mas_left).offset(8);
            make.centerY.equalTo(self.mas_centerY);
        }];
        _btnTitle.text = @"编辑修改";
        self.backgroundColor =[UIColor clearColor];
        
    }
    return self;
}

-(void)drawRect:(CGRect)rect{
    NSLog(@"-------%f",rect.size.width);
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
